set CONCAT_NULL_YIELDS_NULL on
go
use RD_SalesMart;
truncate table dbo.Sales_Star_Facts
go
truncate table dbo.Sales_Star_FactsExt
go
truncate table dbo.Sales_Star_FactsHdr
go
truncate table dbo.Sales_Star_FactsRebates
go
truncate table dbo.Sales_Star_PriceAdjustment
go
truncate table dbo.Sales_Star_PriceLedger
go
truncate table dbo.Sales_Star_SalesRep
go
truncate table dbo.Sales_Star_TransactionType
go
truncate table dbo.FBCCustomerMasterCommissioninfo
go



USE [RD_SalesMart]
GO

/****** Object:  Index [PK_FBCCustomerMasterCommissioninfo]    Script Date: 11/11/2011 11:25:51 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FBCCustomerMasterCommissioninfo]') AND name = N'PK_FBCCustomerMasterCommissioninfo')
ALTER TABLE [dbo].[FBCCustomerMasterCommissioninfo] DROP CONSTRAINT [PK_FBCCustomerMasterCommissioninfo]
GO

/****** Object:  Index [missing_index_378]    Script Date: 11/11/2011 11:25:51 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FBCCustomerMasterCommissioninfo]') AND name = N'missing_index_378')
DROP INDEX [missing_index_378] ON [dbo].[FBCCustomerMasterCommissioninfo] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_376]    Script Date: 11/11/2011 11:25:51 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FBCCustomerMasterCommissioninfo]') AND name = N'missing_index_376')
DROP INDEX [missing_index_376] ON [dbo].[FBCCustomerMasterCommissioninfo] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_Sales_Star_Facts]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'PK_Sales_Star_Facts')
ALTER TABLE [dbo].[Sales_Star_Facts] DROP CONSTRAINT [PK_Sales_Star_Facts]
GO

/****** Object:  Index [IX_ORDERSuffix]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_ORDERSuffix')
DROP INDEX [IX_ORDERSuffix] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_UOMPrimary]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_UOMPrimary')
DROP INDEX [IX_Facts_UOMPrimary] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_TypeID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_TypeID')
DROP INDEX [IX_Facts_TypeID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_TranTypeID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_TranTypeID')
DROP INDEX [IX_Facts_TranTypeID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_TransactionDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_TransactionDate')
DROP INDEX [IX_Facts_TransactionDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ShipToNumber]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ShipToNumber')
DROP INDEX [IX_Facts_ShipToNumber] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ShipDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ShipDate')
DROP INDEX [IX_Facts_ShipDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_SalesRepID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_SalesRepID')
DROP INDEX [IX_Facts_SalesRepID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_RequestedDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_RequestedDate')
DROP INDEX [IX_Facts_RequestedDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_PromisedDelDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_PromisedDelDate')
DROP INDEX [IX_Facts_PromisedDelDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_PriceID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_PriceID')
DROP INDEX [IX_Facts_PriceID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_PriceEffectiveDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_PriceEffectiveDate')
DROP INDEX [IX_Facts_PriceEffectiveDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ParentNumber]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ParentNumber')
DROP INDEX [IX_Facts_ParentNumber] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_OriginalPromisedDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_OriginalPromisedDate')
DROP INDEX [IX_Facts_OriginalPromisedDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_OrderTypeCode]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_OrderTypeCode')
DROP INDEX [IX_Facts_OrderTypeCode] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ItemNumberID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ItemNumberID')
DROP INDEX [IX_Facts_ItemNumberID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ItemNum_UOMPrimary]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ItemNum_UOMPrimary')
DROP INDEX [IX_Facts_ItemNum_UOMPrimary] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ItemNum_UOMAsInput]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ItemNum_UOMAsInput')
DROP INDEX [IX_Facts_ItemNum_UOMAsInput] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_InvoiceDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_InvoiceDate')
DROP INDEX [IX_Facts_InvoiceDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_GLDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_GLDate')
DROP INDEX [IX_Facts_GLDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_FactsHdrID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_FactsHdrID')
DROP INDEX [IX_Facts_FactsHdrID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_FactsExtID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_FactsExtID')
DROP INDEX [IX_Facts_FactsExtID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_CostID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_CostID')
DROP INDEX [IX_Facts_CostID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_CompanyID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_CompanyID')
DROP INDEX [IX_Facts_CompanyID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_CancelDateID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_CancelDateID')
DROP INDEX [IX_Facts_CancelDateID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_BusinessUnitID]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_BusinessUnitID')
DROP INDEX [IX_Facts_BusinessUnitID] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_AddressNumber]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_AddressNumber')
DROP INDEX [IX_Facts_AddressNumber] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ActualDeliveryDate]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_Facts_ActualDeliveryDate')
DROP INDEX [IX_Facts_ActualDeliveryDate] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_AddressNumber_BusinessUnit]    Script Date: 11/11/2011 11:26:04 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_Facts]') AND name = N'IX_AddressNumber_BusinessUnit')
DROP INDEX [IX_AddressNumber_BusinessUnit] ON [dbo].[Sales_Star_Facts] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_JDESOSalesOrderDetail]    Script Date: 11/11/2011 11:26:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsExt]') AND name = N'PK_JDESOSalesOrderDetail')
ALTER TABLE [dbo].[Sales_Star_FactsExt] DROP CONSTRAINT [PK_JDESOSalesOrderDetail]
GO

/****** Object:  Index [IX_FactsExt_UserReservedDate]    Script Date: 11/11/2011 11:26:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsExt]') AND name = N'IX_FactsExt_UserReservedDate')
DROP INDEX [IX_FactsExt_UserReservedDate] ON [dbo].[Sales_Star_FactsExt] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsExt_PaymentTermsID]    Script Date: 11/11/2011 11:26:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsExt]') AND name = N'IX_FactsExt_PaymentTermsID')
DROP INDEX [IX_FactsExt_PaymentTermsID] ON [dbo].[Sales_Star_FactsExt] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsExt_FactsExtID]    Script Date: 11/11/2011 11:26:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsExt]') AND name = N'IX_FactsExt_FactsExtID')
DROP INDEX [IX_FactsExt_FactsExtID] ON [dbo].[Sales_Star_FactsExt] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsExt_DateRelease]    Script Date: 11/11/2011 11:26:16 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsExt]') AND name = N'IX_FactsExt_DateRelease')
DROP INDEX [IX_FactsExt_DateRelease] ON [dbo].[Sales_Star_FactsExt] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_Sales_Star_FactsHdr]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'PK_Sales_Star_FactsHdr')
ALTER TABLE [dbo].[Sales_Star_FactsHdr] DROP CONSTRAINT [PK_Sales_Star_FactsHdr]
GO

/****** Object:  Index [IX_FactsHdr_UserReservedDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_UserReservedDate')
DROP INDEX [IX_FactsHdr_UserReservedDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_ShipDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_ShipDate')
DROP INDEX [IX_FactsHdr_ShipDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_RequestedDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_RequestedDate')
DROP INDEX [IX_FactsHdr_RequestedDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_PromisedDelDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_PromisedDelDate')
DROP INDEX [IX_FactsHdr_PromisedDelDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_PriceEffDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_PriceEffDate')
DROP INDEX [IX_FactsHdr_PriceEffDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_PaymentTermsID]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_PaymentTermsID')
DROP INDEX [IX_FactsHdr_PaymentTermsID] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_OriginalPromDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_OriginalPromDate')
DROP INDEX [IX_FactsHdr_OriginalPromDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_OPLatestLineDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_OPLatestLineDate')
DROP INDEX [IX_FactsHdr_OPLatestLineDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_FutureUseDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_FutureUseDate')
DROP INDEX [IX_FactsHdr_FutureUseDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_FactsHdrID]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_FactsHdrID')
DROP INDEX [IX_FactsHdr_FactsHdrID] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_DateReqShip]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_DateReqShip')
DROP INDEX [IX_FactsHdr_DateReqShip] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_DateActDel]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_DateActDel')
DROP INDEX [IX_FactsHdr_DateActDel] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_CancelDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_CancelDate')
DROP INDEX [IX_FactsHdr_CancelDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsHdr_ActualDelDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_FactsHdr_ActualDelDate')
DROP INDEX [IX_FactsHdr_ActualDelDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_TransactionDate]    Script Date: 11/11/2011 11:26:33 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsHdr]') AND name = N'IX_Facts_TransactionDate')
DROP INDEX [IX_Facts_TransactionDate] ON [dbo].[Sales_Star_FactsHdr] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_Sales_Star_FactsRebates]    Script Date: 11/11/2011 11:26:45 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsRebates]') AND name = N'PK_Sales_Star_FactsRebates')
ALTER TABLE [dbo].[Sales_Star_FactsRebates] DROP CONSTRAINT [PK_Sales_Star_FactsRebates]
GO

/****** Object:  Index [IX_FactsRebates_FactsExtID]    Script Date: 11/11/2011 11:26:45 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_FactsRebates]') AND name = N'IX_FactsRebates_FactsExtID')
DROP INDEX [IX_FactsRebates_FactsExtID] ON [dbo].[Sales_Star_FactsRebates] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_Sales_Star_PriceLedger]    Script Date: 11/11/2011 11:27:00 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_PriceLedger]') AND name = N'PK_Sales_Star_PriceLedger')
ALTER TABLE [dbo].[Sales_Star_PriceLedger] DROP CONSTRAINT [PK_Sales_Star_PriceLedger]
GO

/****** Object:  Index [IX_SequenceNumber]    Script Date: 11/11/2011 11:27:00 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_PriceLedger]') AND name = N'IX_SequenceNumber')
DROP INDEX [IX_SequenceNumber] ON [dbo].[Sales_Star_PriceLedger] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_OrderNumberTypeLineNumber]    Script Date: 11/11/2011 11:27:00 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_PriceLedger]') AND name = N'IX_OrderNumberTypeLineNumber')
DROP INDEX [IX_OrderNumberTypeLineNumber] ON [dbo].[Sales_Star_PriceLedger] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Adjustmentname]    Script Date: 11/11/2011 11:27:00 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_PriceLedger]') AND name = N'IX_Adjustmentname')
DROP INDEX [IX_Adjustmentname] ON [dbo].[Sales_Star_PriceLedger] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [PK_Sales_Star_SalesRep]    Script Date: 11/11/2011 11:27:11 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_SalesRep]') AND name = N'PK_Sales_Star_SalesRep')
ALTER TABLE [dbo].[Sales_Star_SalesRep] DROP CONSTRAINT [PK_Sales_Star_SalesRep]
GO

/****** Object:  Index [IX_SalesRep_SalesRepID]    Script Date: 11/11/2011 11:27:11 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Star_SalesRep]') AND name = N'IX_SalesRep_SalesRepID')
DROP INDEX [IX_SalesRep_SalesRepID] ON [dbo].[Sales_Star_SalesRep] WITH ( ONLINE = OFF )
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [R&G EX Price and LBS-Foodservice_DTA_041912_K56_K25]    Script Date: 5/29/13 1:05:47 PM ******/
DROP INDEX [R&G EX Price and LBS-Foodservice_DTA_041912_K56_K25] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [NET SALES BY CUSTOMER-Foodservice MARGIN_041912_DTA]    Script Date: 5/29/13 1:05:47 PM ******/
DROP INDEX [NET SALES BY CUSTOMER-Foodservice MARGIN_041912_DTA] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K56_K25_K5]    Script Date: 5/29/13 1:05:47 PM ******/
DROP INDEX [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K56_K25_K5] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K56_K25_K37]    Script Date: 5/29/13 1:05:47 PM ******/
DROP INDEX [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K56_K25_K37] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K37_K56_K25_K6_K1_K5_K24_K15_K17_K12_45_53_55]    Script Date: 5/29/13 1:05:47 PM ******/
DROP INDEX [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K37_K56_K25_K6_K1_K5_K24_K15_K17_K12_45_53_55] ON [dbo].[Sales_Star_Facts]
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [IX_ORDERSuffix]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_ORDERSuffix] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_index_Sales_Star_Facts_ychoi_040312]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_index_Sales_Star_Facts_ychoi_040312] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_index_Sales_Star_Facts_2_ychoi_040312]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_index_Sales_Star_Facts_2_ychoi_040312] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_UOMPrimary]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_UOMPrimary] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_TypeID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_TypeID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_TranTypeID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_TranTypeID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_TransactionDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_TransactionDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ShipToNumber]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ShipToNumber] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ShipDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ShipDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_SalesRepID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_SalesRepID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_RequestedDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_RequestedDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_PromisedDelDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_PromisedDelDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_PriceID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_PriceID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_PriceEffectiveDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_PriceEffectiveDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ParentNumber]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ParentNumber] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_OriginalPromisedDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_OriginalPromisedDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_OrderTypeCode]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_OrderTypeCode] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ItemNumberID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ItemNumberID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ItemNum_UOMPrimary]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ItemNum_UOMPrimary] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ItemNum_UOMAsInput]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ItemNum_UOMAsInput] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_InvoiceDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_InvoiceDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_GLDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_GLDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_FactsHdrID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_FactsHdrID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_FactsExtID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_FactsExtID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_CostID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_CostID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_CompanyID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_CompanyID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_CancelDateID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_CancelDateID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_BusinessUnitID]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_BusinessUnitID] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_AddressNumber]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_AddressNumber] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_Facts_ActualDeliveryDate]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_Facts_ActualDeliveryDate] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [IX_AddressNumber_BusinessUnit]    Script Date: 5/29/13 1:07:08 PM ******/
DROP INDEX [IX_AddressNumber_BusinessUnit] ON [dbo].[Sales_Star_Facts]
GO

/****** Object:  Index [PK_Sales_Star_Facts]    Script Date: 5/29/13 1:07:08 PM ******/
ALTER TABLE [dbo].[Sales_Star_Facts] DROP CONSTRAINT [PK_Sales_Star_Facts]
GO

USE [RD_SalesMart]
GO

/****** Object:  Index [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K7_K37_K38_K39_K40_K41_K71_K5_K3_K4_K6_1_33]    Script Date: 5/29/13 1:09:16 PM ******/
DROP INDEX [NET SALES BY  Levels-FOR AOP PURPOSES_DTA_K7_K37_K38_K39_K40_K41_K71_K5_K3_K4_K6_1_33] ON [dbo].[Sales_Star_PriceLedger]
GO


